<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>react_10_函数式组件使用props.html</title>
</head>
<body>
    <div id="test"></div>

    <!-- 引入react 核心库 -->
    <script type="text/javascript" src="./js/react.development.js"></script>
    <!-- 引入react-dom 用于支持react操作dom -->
    <script type="text/javascript" src="./js/react-dom.development.js"></script>
    <!-- 引入babel 用于讲jsx转成js -->
    <script type="text/javascript" src="./js/babel.min.js"></script>
    <!-- 注意：从8开始需要引入一个新的js文件了，目的是对props加上限制 -->
    <script type="text/javascript" src="./js/prop-types.js"></script>

    <!-- 组 件 -->
    <script type="text/babel">
        function Persion(props){
            const {name,age,gender} = props
            return <div>
                <ul>
                    <li>姓名：{name}</li>
                    <li>年龄：{age+1}</li>
                    <li>性别：{gender}</li>
                </ul>
            </div>
        }
        ReactDOM.render(<Persion name={'张三'} age={18} gender={'男'}/>,document.getElementById('test'))
    </script>
</body>

</html>